<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="common/common::common('新增菜单')"/>
    <script src="/static/base/menu/add.js" charset="utf-8"></script>
</head>
<body>

<form class="layui-form layui-form-pane" id="addBaseMenuForm">
    <div class="layui-form-body">
        <div class="layui-form-item">
            <label class="layui-form-label">菜单标题<span class="required">*</span></label>
            <div class="layui-input-block">
                <input type="text" id="title" name="title" lay-verify="required"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">类型</label>
            <div class="layui-input-block" th:with="dicts=${@dict.getType('menu_type')}">
                <input type="radio" name="type"
                       th:each="dict : ${dicts}"
                       th:title="${dict.dictLabel}"
                       th:value="${dict.dictValue}"
                       th:attr="checked=${dict.dictValue eq '1'?true:false}">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">菜单状态</label>
            <div class="layui-input-block" th:with="dicts=${@dict.getType('menu_visible')}">
                <input type="radio" name="visible"
                       th:each="dict : ${dicts}"
                       th:title="${dict.dictLabel}"
                       th:value="${dict.dictValue}"
                       th:attr="checked=${dict.dictValue eq '1'?true:false}">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="href" class="layui-form-label">菜单路径<span class="required">*</span></label>
            <div class="layui-input-block">
                <input type="text" id="href" name="href" autocomplete="off"
                       value="/" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">权限标识<span class="required">*</span></label>
            <div class="layui-input-block">
                <input type="text" id="perms" name="perms" lay-verify="required"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">菜单图标<span class="required">*</span></label>
            <div class="layui-input-block">
                <input type="text" id="icon" name="icon"
                       autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序<span class="required">*</span></label>
            <div class="layui-input-block">
                <input type="text" id="orderNum" name="orderNum" lay-verify="required"
                       onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="2"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <input type="text" id="description" name="description"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <input type="text" th:value="*{parentId}" id="parentId" name="parentId" style="visibility: hidden;">
    <input type="text" value="ok-icon" id="fontFamily" name="fontFamily" style="visibility: hidden;">
    <div class="form-footer">
        <button type="button" class="button-sub" lay-submit lay-filter="saveBaseMenu">提交</button>
        <button type="button" class="button-close" id="buttonClose">关闭</button>
    </div>
</form>
</body>
</html>